﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PloobsEngine.Commands;

namespace PloobsEngine.Tasks
{
    public class TaskCommand : ICommand
    {
        public TaskCommand(ITask task)
        {
            this.task = task;
        }

        private TaskProcessor tp;
        private ITask task;

        #region IComponentCommand Members

        public void execute()
        {
            tp.StartTask(task);
        }

        public void setTarget(object obj)
        {
            this.tp = obj as TaskProcessor;
        }

        public string TargetName
        {
            get { return TaskProcessor.MyName; }
        }

        #endregion
    }
}
